package cn.zwx.common.rocket.consumer.service;

import cn.zwx.base.exception.BizWrapException;
import cn.zwx.common.rocket.consumer.bo.SubscribeBO;
import cn.zwx.common.rocket.consumer.listener.ConsumerListener;
import org.apache.rocketmq.client.consumer.listener.MessageListener;
import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently;
import org.apache.rocketmq.client.consumer.listener.MessageListenerOrderly;

import java.util.List;
/**
 * @author zhangwenxue
 */
public interface MqConsumerService {


    /**
     *  消费者订阅[事务消息,普通消息,延时消息]
     * @param boList 传入订阅消息集合
     * @param consumerListener 消息监控类
     * @throws BizWrapException 业务异常
     **/
    void subscribeForDefault(List<SubscribeBO> boList, ConsumerListener consumerListener) throws BizWrapException;


    /**
     *   顺序消息消费[批量]
     * @param boList 传入订阅消息集合
     * @param consumerListener 消息监控类
     * @author zhangwenxue
     * @throws BizWrapException 业务异常
     **/
    void subscribeForOrder(List<SubscribeBO> boList, ConsumerListener consumerListener) throws BizWrapException;
}
